//
//  MCAddBankCardAddressTableViewCell.m
//  TLYL
//
//  Created by MC on 2017/7/11.
//  Copyright © 2017年 TLYL01. All rights reserved.
//

#import "MCAddBankCardAddressTableViewCell.h"

@interface MCAddBankCardAddressTableViewCell ()


@property (nonatomic,strong)UIButton * btn_Province;
@property (nonatomic,strong)UIView   * view_line;
@property (nonatomic,strong)UIButton * btn_City;

@end

@implementation MCAddBankCardAddressTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self){
        [self initView];
    }
    return self;
}

- (void)initView{
    
    self.backgroundColor=[UIColor whiteColor];
    
  
    
    _btn_Province =[[UIButton alloc]init];
    _btn_Province.backgroundColor=[UIColor whiteColor];
    [_btn_Province setTitle:@"请选择省份>" forState:UIControlStateNormal];
    [self  addSubview:_btn_Province];
    [_btn_Province setTitleColor:RGB(100, 100, 100) forState:UIControlStateNormal];
    [_btn_Province addTarget:self action:@selector(action_SelectProvince) forControlEvents:UIControlEventTouchUpInside];
    _btn_Province.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    
    
    _view_line=[[UIView alloc]init];
    [self addSubview:_view_line];
    _view_line.backgroundColor=RGB(200, 200, 200);
    
    _btn_City =[[UIButton alloc]init];
    _btn_City.backgroundColor=[UIColor whiteColor];
    [_btn_City setTitle:@"请选择市区>" forState:UIControlStateNormal];
    [self  addSubview:_btn_City];
    [_btn_City setTitleColor:RGB(100, 100, 100) forState:UIControlStateNormal];
    [_btn_City addTarget:self action:@selector(action_SelectCity) forControlEvents:UIControlEventTouchUpInside];
    _btn_City.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    
    
    [self relayOutConstraints];
}



-(void)relayOutConstraints{
    
    [_btn_Province mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self);
        make.left.equalTo(self.mas_left).offset(10);
        make.bottom.equalTo(self);
        make.width.mas_equalTo(G_SCREENWIDTH/2.0-10);
        
    }];
    
    
    [_view_line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self);
        make.bottom.equalTo(self);
        make.left.equalTo(_btn_Province.mas_right).offset(0);
        make.width.mas_equalTo(0.5);
    }];
    
    [_btn_City mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self);
        make.bottom.equalTo(self);
        make.left.equalTo(_view_line.mas_right).offset(10);
        make.right.equalTo(self.mas_right).offset(-10);
    }];
    
}

/*
 * 选省份
 */
-(void)action_SelectProvince{
    
}


/*
 * 选择市区
 */
-(void)action_SelectCity{
    
}

-(void)setDataSource:(id)dataSource{
    
    _dataSource=dataSource;
    
    
}

+(CGFloat)computeHeight:(id)info{
    
    return 40;
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
